package com.duobaoyu.dby.supply.db.repository.message;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.duobaoyu.dby.supply.db.entity.message.DelayMessage;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.data.mongodb.core.query.Update;

import java.util.List;

/**
 * @author liyang
 * @version 1.0.0
 * @ClassName DelayMessageService
 * @Description 延时消息记录service
 * @createTime 11:27:00 2023/10/07
 */
public interface DelayMessageRepository /*extends DbyService<DelayMessage>*/ {
    boolean save(DelayMessage delayMessage);

    boolean updateStatusById(String delayMessageId, Integer messageStatus,Integer preStatus,boolean incrementalRetryCount);

    boolean updateStatusById(String delayMessageId, Integer messageStatus,boolean incrementalRetryCount);

    DelayMessage findByUniqueKey(String uniqueKey);

    boolean existsByUniqueKey(String uniqueKey);

    Page<DelayMessage> page(Page<Object> page, Query query);

    Boolean updateDelayMessageStatus(Query query, Update update);

    DelayMessage findById(String delayMessageId);

    List<DelayMessage> delayMessageList(int skipCount, int limit, List<Integer> messageStatusList, Long currentMilli, Integer lteRetryCount);
}
